{include file='admin/header.html'}

<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.menu_name}</label>
        <div class="layui-input-inline">
            <input type="text" name="title" value="" required lay-verify="required" placeholder="{$tran.input_menu_name}"
                autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.icon}</label>
        <div class="layui-input-inline" style="width: auto">
            <input type="text" name="icon" value="" placeholder="" autocomplete="off" class="layui-input icon-selected">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.parent_menu}</label>
        <div class="layui-input-inline">
            <select name="pid" lay-verify="required">
                <option value="">{$tran.choose}</option>
                <option value="0" {if $pid==0} selected{/if}>{$tran.top_menu}</option>
                {foreach from="$trees" item="tree"}
                <option value="{$tree.id}" {if $pid==$tree.id} selected{/if}>{$tree.title}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.controller}</label>
        <div class="layui-input-inline">
            <input type="text" name="controller" value="" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.action}</label>
        <div class="layui-input-inline">
            <input type="text" name="action" value="" placeholder="" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.sort}</label>
        <div class="layui-input-inline">
            <input type="number" name="sort" value="0" required lay-verify="required|number" autocomplete="off"
                class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.menu}</label>
        <div class="layui-input-block">
            <input type="hidden" name="is_menu" value="1">
            <input type="checkbox" name="is_menu" value="0" lay-skin="switch" checked lay-text="YES|NO">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">{$tran.status}</label>
        <div class="layui-input-block">
            <input type="hidden" name="status" value="1">
            <input type="checkbox" name="status" value="0" lay-skin="switch" checked lay-text="ON|OFF">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button type="button" class="layui-btn" lay-submit="" lay-filter="submit">{$tran.save}</button>
            <button type="reset" class="layui-btn layui-btn-primary">{$tran.reset}</button>
        </div>
    </div>
</form>

<script>
    // iconSelectedPlus组件
    layui.config({
        base: '../../../../static/res/layui_exts/'
    }).extend({
        iconSelectedPlus: 'iconSelectedPlus'
    }).use(['iconSelectedPlus'], function () {
        var iconSelectedPlus = layui.iconSelectedPlus;
        iconSelectedPlus.render('.icon-selected');
    });
</script>

{include file='admin/inc/form.html'}

{include file='admin/footer.html'}